package com.smart.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import com.smart.util.DBUtil;

public class UserPaymentRecordDAO {
  public int isPayed(String date,int houseId) throws SQLException
  {
	   Connection conn = DBUtil.getConnection();
		String sql = "select * from user_payment_record where date=? and house_id=?";
		PreparedStatement pSt = conn.prepareCall(sql);
		pSt.setString(1,date);
		pSt.setInt(2, houseId);
		ResultSet rs=pSt.executeQuery();
		if(rs.next())
		{
			  return 1;
		 }
		 else
		 {
			   return 0;
		  }
  }
}
